AppService.accumulate   A
last analyzed

Complexity

Conditions 1

Size

Total Lines 3
Code Lines 3

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
eloc 3
dl 0
loc 3
rs 10
c 0
b 0
f 0
cc 1
1
import { Controller, Inject } from '@nestjs/common';
2
import { EventPattern } from '@nestjs/microservices';
3
import { TRANSPORT_EVENT_BUS_PATTERN, TRANSPORT_EVENT_BUS_SERVICE, TransportEvent } from 'nestjs-transport-eventbus';
4
import { IEvent, IEventBus } from '@nestjs/cqrs';
5
6
@Controller()
7
export class AppService {
8
9
  constructor(
10
      @Inject(TRANSPORT_EVENT_BUS_SERVICE) private readonly eventBus: IEventBus
11
  ){
12
13
  }
14
  @EventPattern(TRANSPORT_EVENT_BUS_PATTERN)
15
  accumulate(@TransportEvent() event: IEvent): void {
16
    this.eventBus.publish(event);
17
  }
18
}
19